package com.qnbc.mystery.pojo.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qnbc.mystery.core.annotation.Excel;
import com.qnbc.mystery.core.domain.BaseEntity;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 地址信息对象 address_copy1
 *
 * @author guzj
 * @date 2024-01-24
 */
@Setter
@Getter
@Data
public class Address {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * 区编码
     */
    @Excel(name = "区编码")
    private String districtCode;

    /**
     * 区名称
     */
    @Excel(name = "区名称")
    private String districtName;

    /**
     * 市编码
     */
    @Excel(name = "市编码")
    private String cityCode;

    /**
     * 市名称
     */
    @Excel(name = "市名称")
    private String cityName;

    /**
     * 省编码
     */
    @Excel(name = "省编码")
    private String provinceCode;

    /**
     * 省名称
     */
    @Excel(name = "省名称")
    private String provinceName;

    /**
     * 详细收货地址
     */
    @Excel(name = "详细收货地址")
    private String address;

    /**
     * 收货人
     */
    @Excel(name = "收货人")
    private String consignee;

    /**
     * 联系电话
     */
    @Excel(name = "联系电话")
    private String phone;

    /**
     * 创建人
     */
    @Excel(name = "创建人")
    private String createdBy;

    /**
     * 更新人
     */
    @Excel(name = "更新人")
    private String updatedBy;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date updatedTime;

    /**
     * 创建日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdTime;

    /**
     * 邮编
     */
    @Excel(name = "邮编")
    private String postcode;

    /**
     * 是否默认地址（1 默认  2 非默认）
     */
    @Excel(name = "是否默认地址", readConverterExp = "1=,默=认,2=,非=默认")
    private String defaultNot;


    @TableField(exist = false)
    private Integer pageSize;
    @TableField(exist = false)
    private Integer pageNum;


    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setDistrictCode(String districtCode) {
        this.districtCode = districtCode;
    }

    public String getDistrictCode() {
        return districtCode;
    }

    public void setDistrictName(String districtName) {
        this.districtName = districtName;
    }

    public String getDistrictName() {
        return districtName;
    }

    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }

    public String getCityCode() {
        return cityCode;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public String getCityName() {
        return cityName;
    }

    public void setProvinceCode(String provinceCode) {
        this.provinceCode = provinceCode;
    }

    public String getProvinceCode() {
        return provinceCode;
    }

    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }

    public String getProvinceName() {
        return provinceName;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getAddress() {
        return address;
    }

    public void setConsignee(String consignee) {
        this.consignee = consignee;
    }

    public String getConsignee() {
        return consignee;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPhone() {
        return phone;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public String getCreatedBy() {
        return createdBy;
    }

    public void setUpdatedBy(String updatedBy) {
        this.updatedBy = updatedBy;
    }

    public String getUpdatedBy() {
        return updatedBy;
    }

    public void setUpdatedTime(Date updatedTime) {
        this.updatedTime = updatedTime;
    }

    public Date getUpdatedTime() {
        return updatedTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setPostcode(String postcode) {
        this.postcode = postcode;
    }

    public String getPostcode() {
        return postcode;
    }

    public void setDefaultNot(String defaultNot) {
        this.defaultNot = defaultNot;
    }

    public String getDefaultNot() {
        return defaultNot;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("districtCode", getDistrictCode())
                .append("districtName", getDistrictName())
                .append("cityCode", getCityCode())
                .append("cityName", getCityName())
                .append("provinceCode", getProvinceCode())
                .append("provinceName", getProvinceName())
                .append("address", getAddress())
                .append("consignee", getConsignee())
                .append("phone", getPhone())
                .append("createdBy", getCreatedBy())
                .append("updatedBy", getUpdatedBy())
                .append("updatedTime", getUpdatedTime())
                .append("createdTime", getCreatedTime())
                .append("postcode", getPostcode())
                .append("defaultNot", getDefaultNot())
                .toString();
    }
}
